package o;

import android.util.Log;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

final class bkl {
    bkl() {
    }

    public static Class<?> ˎ(String str) {
        Class<?> cls = null;
        if (str != null) {
            try {
                cls = Class.forName(str);
            } catch (ClassNotFoundException e) {
                Log.e("ReflectUtil", "ClassNotFoundException: " + str);
            } catch (ExceptionInInitializerError e2) {
                Log.e("ReflectUtil", "ExceptionInInitializerError: " + str);
            } catch (LinkageError e3) {
                Log.e("ReflectUtil", "LinkageError: " + str);
            }
        }
        return cls;
    }

    public static Method ॱ(Class<?> cls, String str, Class<?>... clsArr) {
        Method method = null;
        if (cls != null) {
            try {
                method = cls.getMethod(str, clsArr);
            } catch (SecurityException e) {
                Log.w("ReflectUtil", "SecurityException: " + e.getCause());
            } catch (NoSuchMethodException e2) {
                Log.w("ReflectUtil", "NoSuchMethodException: " + str);
            }
        }
        return method;
    }

    public static Object ˋ(Object obj, Method method, Object... objArr) {
        Object obj2 = null;
        if (method != null) {
            try {
                bkk.ˊ(obj, method);
                obj2 = method.invoke(obj, objArr);
            } catch (IllegalAccessException e) {
                Log.e("ReflectUtil", "IllegalAccessException: " + e.getCause() + ", method: " + method.getName());
            } catch (IllegalArgumentException e2) {
                Log.e("ReflectUtil", "IllegalArgumentException: " + e2.getCause() + ", method: " + method.getName());
            } catch (InvocationTargetException e3) {
                Log.e("ReflectUtil", "InvocationTargetException: " + e3.getCause() + ", method: " + method.getName());
            }
        }
        return obj2;
    }

    public static Object ॱ(Object obj, Object obj2, Method method, Object... objArr) {
        if (method == null) {
            return obj2;
        }
        try {
            bkk.ˊ(obj, method);
            Object invoke = method.invoke(obj, objArr);
            if (invoke != null) {
                return invoke;
            }
            return obj2;
        } catch (IllegalAccessException e) {
            Log.e("ReflectUtil", "IllegalAccessException in invoke: " + e.getCause() + ", method: " + method.getName());
            return obj2;
        } catch (IllegalArgumentException e2) {
            Log.e("ReflectUtil", "IllegalArgumentException in invoke: " + e2.getCause() + ", method: " + method.getName());
            return obj2;
        } catch (InvocationTargetException e3) {
            Log.e("ReflectUtil", "InvocationTargetException in invoke: " + e3.getCause() + ", method: " + method.getName());
            return obj2;
        }
    }
}
